<template>
  <el-dialog v-dialogDrag :visible.sync="dialogVisible" title="设备点检单" width="1000px" :close-on-click-modal="false">
    <button-group ref="buttonGroup" @cancel="dialogVisible = false" />
    <el-row>
      <div class="detailsTop">
        <span>设备点检单</span>
        <el-divider content-position="right">{{ detailInfo.pointNo }}</el-divider>
      </div>
      <div class="detailCont detailDialogFont threeDetailStyle">
        <ul>
          <li>
            <b>设备名称</b>
            <span>{{ detailInfo.equipName }}</span>
          </li>
          <li>
            <b>设备编码</b>
            <span>{{ detailInfo.equipCode }}</span>
          </li>
          <li>
            <b>设备类型</b>
            <span>{{ detailInfo.type }}</span>
          </li>
          <li>
            <b>点检人</b>
            <span>{{ detailInfo.checkUserName }}</span>
          </li>
          <li>
            <b>点检结果</b>
            <span>{{ detailInfo.result === 1 ? '通过':'不通过' }}</span>
          </li>
          <li></li>
          <li class="oneHang">
            <b>点检说明</b>
            <span>{{ detailInfo.checkInstructions }}</span>
          </li>
        </ul>
        <el-table ref="table" :data="detailInfo.itemList" border stripe class="tabBoxCont" height="300px">
          <!-- 点检项 -->
          <el-table-column label="点检项" width="200px" show-overflow-tooltip>
            <template #default="{ row }">{{ row.itemName }}{{ row.itemCode ? '【' + row.itemCode + '】' : '' }}</template>
          </el-table-column>
          <!-- 描述 -->
          <el-table-column label="点检描述" prop="itemRemark" show-overflow-tooltip />
          <!-- 备注-->
          <el-table-column prop="remark" label="备注" show-overflow-tooltip />
          <!-- 点检结果-->
          <el-table-column label="点检结果" width="150px" show-overflow-tooltip>
            <template #default="{ row }">{{ row.itemResult === 1 ? '通过':'不通过' }}</template>
          </el-table-column>
        </el-table>
      </div>
    </el-row>
    <bottom-font ref="bottomFont" :obj-name="detailInfo.checkUserName ? detailInfo.checkUserName : this.$store.getters.compInfo.userName" :obj-date="detailInfo.checkTime" />
  </el-dialog>
</template>

<script>
import bottomFont from '@/components/BottomFont'
export default {
  components: { bottomFont },
  props: {},

  data() {
    return {
      detailInfo: {},
      dialogVisible: false // 对话框状态
    }
  },

  watch: {},

  mounted() {},

  methods: {
    async getInfo(row) {
      this.dialogVisible = true
      const res = await this.$axios.get(
        `/equip/point/check/record/detail/${row.id}`
      )
      if (res && res.data.code === 200) {
        this.detailInfo = res.data.data
        this.detailInfo.type = row.type
      }
    }
  }
}
</script>

<style lang='scss' scoped>
</style>

<style lang="scss">
</style>
